package com.train;

import com.train.pojos.JJ;
import com.train.pojos.Jay;
import com.train.pojos.Vae;
import com.train.proxy.CglibProxy;

public class Main {
    public static void main(String[] args) {
        Jay jay = new Jay("周杰伦",31);
        Vae vae = new Vae("许嵩",23);
        JJ jj = new JJ("林俊杰",29);

        CglibProxy cglibProxy = new CglibProxy(jay);
        Jay jayChou = (Jay) cglibProxy.getTargetProxy();
        String res = jayChou.sing("说了再见");
        System.out.println(res);

        cglibProxy = new CglibProxy(vae);
        Vae xu_song = (Vae) cglibProxy.getTargetProxy();
        res = xu_song.sing("南山忆");
        System.out.println(res);

        cglibProxy = new CglibProxy(jj);
        JJ lin_jun_jie = (JJ) cglibProxy.getTargetProxy();
        res = lin_jun_jie.sing("江南");
        System.out.println(res);
    }
}